<%--
    Document   : index
    Created on : Mar 10, 2014, 10:54:45 PM
    Author     : Anton Strack
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib prefix="csd" tagdir="/WEB-INF/tags" %>
<p>Created By: ${bean.getDerivedValue("CreatedByName")} on <csd:displayTimestamp timestamp="${bean.createdDate}"></csd:displayTimestamp>
    <c:if test="${bean.createdDate != bean.updatedDate}">
        and updated
        <c:if test="${bean.updatedById != bean.createdById}">
            by: ${bean.getDerivedValue("UpdatedByName")}
        </c:if>
        on <csd:displayTimestamp timestamp="${bean.updatedDate}"></csd:displayTimestamp>
    </c:if>
</p>
<p>
    <c:choose>
        <c:when test="${bean.stateId == 8}">
            <span class="bold">This is a prior version of the ${fn:toLowerCase(bean.getDerivedValue('ResourceTypeName'))}.</span>
        </c:when>
        <c:otherwise>
            <a href="${req.contextPath}?action=update&resource=${fn:toLowerCase(bean.getDerivedValue('ResourceTypeName'))}&id=${bean.id}">Update ${bean.getDerivedValue("ResourceTypeName")}</a> | <a href="${req.contextPath}?action=delete&resource=${fn:toLowerCase(bean.getDerivedValue('ResourceTypeName'))}&id=${bean.id}">Delete ${bean.getDerivedValue("ResourceTypeName")}</a> | <a href="${req.contextPath}?action=add&resource=category&for=${fn:toLowerCase(bean.getDerivedValue('ResourceTypeName'))}&id=${bean.id}">Add Categories</a> | <a href="${req.contextPath}?action=create&resource=task&for=${fn:toLowerCase(bean.getDerivedValue('ResourceTypeName'))}&id=${bean.id}">Create Task</a>
        </c:otherwise>
    </c:choose>
    <c:if test="${bean.parentId != 0}"><%-- 0 means there isn't a previous version of this post so don't show the link--%>
        | <a href="${req.contextPath}?action=view&resource=${fn:toLowerCase(bean.getDerivedValue('ResourceTypeName'))}&id=${bean.parentId}">Read prior version</a>
    </c:if>
</p>